#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>

/*
 * 根据userid获取对应的用户名
 * */
int main(int argc, char *argv[])
{

	struct passwd *pwdline;
	if (argc < 2) {
		fprintf(stderr, "usage...\n");
		exit(1);
	}
	
	pwdline = getpwuid(atoi(argv[1]));
	puts(pwdline->pw_name);

	exit(0);
}
